package com.dilili;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @Description: TODO
 * @Data: 2020-06-01 11:40:25
 * @Pacakge: com.dilili
 * @ClassName: RibbonClient
 * @Version: v1.0.0
 * @Author: dilili
 */
@SpringBootApplication
@EnableEurekaClient  //: bug：https://www.cnblogs.com/cangqinglang/p/11704475.html
//@EnableDiscoveryClient
public class RibbonClientApplication {
    public static void main(String[] args) {
        SpringApplication.run(RibbonClientApplication.class, args);
    }

    // 实现负载均衡
    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
